/****************************************
*  This file created using "Writer B"   *
*      a program written by CTonk       *
*          ctonk87@hotmail.com          *
*     [timestamp 02/20/06  12:51:00]    *
****************************************/

// Exit.cpp

#ifndef CPP_EXIT
#define CPP_EXIT

#include "Exit.h"


// Constructors...
Exit::Exit()
{
	_there = false;
	_point = 0;
	_door = false;
	_open = true;
	_lock = false;
	_locked = false;
	_key = 0;
}

Exit::Exit( Exit& it )
{
	_there = it.GetThere();
	_point = it.GetPoint();
	_door = it.GetDoor();
	_open = it.GetOpen();
	_lock = it.GetLock();
	_locked = it.GetLocked();
	_key = it.GetKey();
}

Exit::~Exit()
{
}

// Operators...
Exit& Exit::operator = ( Exit& it )
{
	_there = it.GetThere();
	_point = it.GetPoint();
	_door = it.GetDoor();
	_open = it.GetOpen();
	_lock = it.GetLock();
	_locked = it.GetLocked();
	_key = it.GetKey();
	return *this;
}

// Public accessor methods...
bool Exit::GetThere()
{
	return _there;
}

void Exit::SetThere( bool there )
{
	_there = there;
}

int Exit::GetPoint()
{
	return _point;
}

void Exit::SetPoint( int point )
{
	_point = point;
}

bool Exit::GetDoor()
{
	return _door;
}

void Exit::SetDoor( bool door )
{
	_door = door;
}

bool Exit::GetOpen()
{
	return _open;
}

void Exit::SetOpen( bool open )
{
	_open = open;
}

bool Exit::GetLock()
{
	return _lock;
}

void Exit::SetLock( bool lock )
{
	_lock = lock;
}

bool Exit::GetLocked()
{
	return _locked;
}

void Exit::SetLocked( bool locked )
{
	_locked = locked;
}

int Exit::GetKey()
{
	return _key;
}

void Exit::SetKey( int key )
{
	_key = key;
}

// Other methods...
void Exit::Display( std::ostream& out )
{
	out << "-Exit-";
	out << "\nThere: " << _there;
	out << "\nPoint: " << _point;
	out << "\nDoor: " << _door;
	out << "\nOpen: " << _open;
	out << "\nLock: " << _lock;
	out << "\nLocked: " << _locked;
	out << "\nKey: " << _key;
	return;
}

void Exit::Display( std::string& out )
{
	out << "-Exit-";
	out << "\nThere: " << _there;
	out << "\nPoint: " << _point;
	out << "\nDoor: " << _door;
	out << "\nOpen: " << _open;
	out << "\nLock: " << _lock;
	out << "\nLocked: " << _locked;
	out << "\nKey: " << _key;
	return;
}

const char* Exit::StringName( int x )
{
	switch ( x )
	{
		case 0: return "North";
		case 1: return "East";
		case 2: return "South";
		case 3: return "West";
		case 4: return "Up";
		case 5: return "Down";
		default: return "None";
	}
}

void Exit::Save( std::ofstream& save ) {
	save << _there << ' ' << _point << ' ' << _door << ' '
		 << _open << ' ' << _lock << ' ' << _locked << ' '
		 << _key << '\n';
	return;
}

void Exit::Load( std::ifstream& load ) {
	load >> _there >> _point >> _door >> _open >> _lock >> _locked >> _key;
	return;
}



#endif // #ifndef CPP_EXIT
